using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DirectMidi;

namespace MKDS_Course_Editor
{
    class Extensions2:CDLSLoader
    {
        public void LoadDLSFromMem(byte[] pDLSFile, out CCollection Collection)
        {
            //pDLSFile.CopyTo(Properties.Resources.DLS, 0);
            //System.Windows.Forms.Application.RenderWithVisualStyl
            //d.LoadDLSFromResource("DLS", "Files", out Collection);
            //DirectMidi.CAudioPath a = new CAudioPath();
            //unsafe
            //{
                //@base->m_pLoader->GetObject();
            //}
            //IDirectMusicTool g = (IDirectMusicTool)(d);
            Collection = new CCollection();
           //object c = new object();
            //Collection = (CCollection)c;
            /*HRESULT hr = DM_FAILED;
            DMUS_OBJECTDESC dmusdesc;
            TCHAR[] strMembrFunc = _T("CDLSLoader::LoadDLSFromMem()");

            // Sets to 0 the DMUS structure

            ZeroMemory(&dmusdesc, sizeof(DMUS_OBJECTDESC));
            dmusdesc.dwSize = sizeof(DMUS_OBJECTDESC);
            dmusdesc.guidClass = CLSID_DirectMusicCollection;
            dmusdesc.llMemLength = llDLSSize;
            dmusdesc.pbMemData = pDLSFile;

            _tcscpy(dmusdesc.wszName, _T("DLS File"));
            //dmusdesc.guidObject	= GUID_DefaultGMCollection;
            //dmusdesc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_OBJECT;

            dmusdesc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_MEMORY;

            UnloadCollection(Collection);	// In case the object is already with data
            if (m_pLoader)	// Loads the DLS file
            {
                if (FAILED(hr = m_pLoader->GetObject(&dmusdesc, IID_IDirectMusicCollection, (void**)&Collection.m_pCollection)))
                    throw CDMusicException(strMembrFunc, hr, __LINE__);
            }
            else throw CDMusicException(strMembrFunc, hr, __LINE__);

            return S_OK;*/


        }

    }
    /*class DMUS_OBJECTDESC {
  int         dwSize;
  int         dwValidData;
  Guid          guidObject;
  Guid        guidClass;
  _FILETIME      ftDate;
  int  vVersion;
  string         wszName;
  string         wszCategory;
  string         wszFileName;
  long      llMemLength;
  byte[]        pbMemData;
  IStream     pStream;
}*/
}
